/*
 * @Author: doing
 * @Date: 2023-09-07 19:34:04
 * @LastEditors: git config user.name && git config user.email
 * @LastEditTime: 2023-09-16 22:15:18
 * @FilePath: \水果新鲜识别项目\web-admin\src\api\role.js
 * @Description: 
 * 角色api
 * Copyright (c) 2023 by 1540265624@qq.com, All Rights Reserved. 
 */

import axios from '~/axios'


//获取到角色信息
function getRole(param){
    console.log(param)
    return axios.get('/v1/role/page',{
        params: param
    })
}

//添加角色信息
function addRole(body){
    return axios.post('/v1/role/create',body)
}

//编辑角色
function updateRole(body){
    return axios.put('/v1/role/edit',body)
}

//删除角色
function deleteRole(id){
    return axios.delete(`/v1/role/del?id=${id}`)
}

//更新角色菜单表
function updateRoleMenu(body){
    return axios.put('/v1/role/updatePerm',body)
}

export default {
    getRole,
    addRole,
    updateRole,
    deleteRole,
    updateRoleMenu
}